<?php
/*Класс для создания галереи используя плагин Gallery View основанный на jQuery
Автор: Andrew Shapovalov
Созданно: 06.03.2010
Обновленно: */

/*Класс галереи*/
class SHAV_GalleryView
{
	var $sizePanel = array('width'=>300, 'height'=>200);
	var $sizeFrame = array('width'=>100, 'height'=>50);
	var $idGallery = 'photos';
	var $contnet = '';
	var $images = array();

	/*Конструктор*/
	function SHAV_GalleryView(){}

	/*Выводит галерею*/
	function drawGallery($isDraw = false)
	{
		$this->content = '<!-- InstanceBeginEditable name="head" -->
		<script type="text/javascript">
		$(document).ready(function(){
			$(\'#'.$this->idGallery.'\').galleryView({
				panel_width: '.$this->sizePanel['width'].',
				panel_height: '.$this->sizePanel['height'].',
				frame_width: '.$this->sizeFrame['width'].',
				frame_height: '.$this->sizeFrame['height'].',
				show_captions: true,
				overlay_opacity: 0.0,
				transition_interval: 0,
				background_color: \'white\'
			});
		});
		</script>
		<!-- InstanceEndEditable -->';
		$this->content .= '<div id="'.$this->idGallery.'" class="galleryview">';

		$panels = '';
		$bottom = '';
		foreach($this->images as $img)
		{
			$panels .= '<div class="panel">';
			$panels .= '<img src="'.$img['thumb'].'" />';
			$panels .= '<div class="panel-overlay">';
			$panels .= '<h2>'.$img['title'].'</h2>';
			$panels .= '<p>'.$img['desc'].'</p>';
			$panels .= '</div>';
			$panels .= '</div>';

			$bottom .= '<li><img src="'.$img['image'].'" alt="'.$img['title'].'" title="'.$img['title'].'" /></li>';
		}
		//$this->content .= $panels;
		
		$this->content .= '<ul class="filmstrip">';
		$this->content .= $bottom;
		$this->content .= '</ul>';
		$this->content .= '</div>';
		
		if($isDraw = false)
			echo $this->content;
		else
			return $this->content;
	}
}
?>